<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        *{
            margin: 0;
            padding: 0;
        }
        .box{
            display: flex;
            justify-content: space-between;
        }
        span{
            display: inline-block;
            width: 147px;
            height:50px;
            /* background-color: orange; */
            text-align: center;
            line-height: 50px;
        }
        ul{
            width: 450px;
            height: auto;
            border: 1px solid black;
            display: none;
            box-sizing: border-box;
            /* line-height: 30px; */
        }
        li{
            font-size: 20px;
            
        }
        .show{
            display: block;
        }
        .shows{
            background-color: orange;
        }
    </style>
</head>
<body>
    <div class="box">
        <div>
            <span class="shows">标题一</span>
            <span>标题二</span>
            <span>标题三</span>
            <ul class="show">
                <li>11111111</li>
                <li>11111111</li>
                <li>11111111</li>
                <li>11111111</li>
                <li>11111111</li>
                <li>11111111</li>
            </ul>
            <ul>
                <li>2222222222</li>
                <li>2222222222</li>
                <li>2222222222</li>
                <li>2222222222</li>
                <li>2222222222</li>
                <li>2222222222</li>
            </ul>
            <ul>
                <li>3333333333</li>
                <li>3333333333</li>
                <li>3333333333</li>
                <li>3333333333</li>
                <li>3333333333</li>
                <li>3333333333</li>
            </ul>
        </div>
    </div>
    <script>
        let spans = document.querySelectorAll("span")
        let uls = document.querySelectorAll("ul")

        for(let i = 0;i<spans.length;i++){
            spans[i].onclick = function(e){
                
                document.querySelector(".shows").className = ""
                document.querySelector(".show").className = ""

                this.classList.add("shows")
                uls[i].classList.add("show")
            }
        }










        
    </script>
</body>
</html>